package com.sxx.beautifulcity.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.PopupMenu;
import android.widget.TextView;

import com.sxx.beautifulcity.R;
import com.sxx.beautifulcity.popmenu.CommonPopMenu;

/**
 * Created by dllo on 15/11/7.
 * 烧烤详情
 */
public class BarbecuteDetailActivity extends AppCompatActivity implements View.OnClickListener {
    private WebView barbecuteWb;
    private String Srcurl;
    private TextView titleTv , moreTv;
    private ImageView backIv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.webview_baebecute);
        titleTv = (TextView) findViewById(R.id.titleTv);
        titleTv.setText("烧烤");
        backIv = (ImageView) findViewById(R.id.backIV);
        backIv.setOnClickListener(this);

        barbecuteWb = (WebView) findViewById(R.id.barbecuteWb);
        Intent intent = getIntent();
        Srcurl = intent.getStringExtra("Srcurl");
        Log.i("hjjdsgvkld" , Srcurl);
        barbecuteWb.loadUrl(Srcurl);
        moreTv = (TextView) findViewById(R.id.moreTv);
        moreTv.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.backIV:
                Intent intent = new Intent(this , MainActivity.class);
                startActivity(intent);
                finish();
                overridePendingTransition(R.anim.left_out, R.anim.right_into);
                break;
            case R.id.moreTv:
                PopupMenu menu = CommonPopMenu.setHelpShopPopMenu(v , Srcurl);
                break;
        }

    }
}
